package com.iwhalecloud.bss.kite.cucc.web.service.accept.handler.attr;

import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.common.constant.LocalKeyConsts;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import com.iwhalecloud.bss.kite.service.attr.handler.AbstractAttrHandler;
import com.ztesoft.bss.common.util.ContextUtil;

/**
 * CPE设备情况
 * */
public class CPEEquipmentStatusHandler extends AbstractAttrHandler {

    @Override
    public void after(KiteAttr attr, KiteInst inst, AttrData data) {
        super.after(attr, inst, data);
        //非北京移除“客户设备局方投资"枚举值
        String provinceCode = ContextUtil.getLoginInfo().getUserInfo().getPostProvinceNbr();
        if(!LocalKeyConsts.PROVINCE_BEIJING.equals(provinceCode)){
            attr.getAttrValues().removeIf(targetAttr -> KiteStringUtils.equals(targetAttr.getAttrValue(), "1_0000154"));
        }
    }
}
